function [err] = set_window_arg(tag, value, direct)

err = 0;
h = findobj('Tag', tag);
if(~ishandle(h)) % not found
   err = 1;
   return;
end
if(nargin == 3)
   set(h, 'value', value); % direct set of the value for lists
   return;
end;
if(ischar(value))
   set(h, 'String', value);
else
   set(h, 'String', num2str(value));
end

return;
